Release 10.1A: OpenEdge Development:
Java Open Clients


Defining the return type for a user-defined function

You must specify the return type for a user-defined function as part of setting up the parameters. You can set this return type using the following method on the com.progress.open4gl.javaproxy.ParamArray object:

Syntax
public void setReturnType(int proType) throws Open4GLException 

proType

Specifies a Progress 4GL data type returned by the user-defined function and indicated by a class constant defined in the com.progress.open4gl.Parameter class, as shown in Table 11–3.

Table 11–3: User-defined function return types for the OpenAPI 
Progress data type
com.progress.open4gl.Parameter
class constant
CHARACTER 
PRO_CHARACTER 
COM-HANDLE 
PRO_COMHANDLE 
DATE 
PRO_DATE 
DATETIME 
PRO_DATETIME 
DATETIME-TZ 
PRO_DATETIMETZ 
DECIMAL 
PRO_DECIMAL 
INTEGER 
PRO_INTEGER  
LOGICAL 
PRO_LOGICAL 
RAW 
PRO_RAW 
RECID 
PRO_RECID 
ROWID 
PRO_ROWID 
WIDGET-HANDLE  
PRO_WIDGETHANDLE 

Note: LONGCHAR, MEMPTR, TABLE, TABLE-HANDLE, DATASET, and DATASET-HANDLE cannot be return types of a user-defined function.

For example, to set the return type for a user-defined function to the 4GL INTEGER data type, you can invoke the setReturnType() method a on a ParamArray object, parms, as follows:

parms.setReturnType(Parameter.PRO_INTEGER); 


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095